package github.flandre.examplemod.common.key;

import github.flandre.examplemod.examplemod;
import net.minecraft.client.settings.KeyBinding;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;

import java.awt.event.KeyEvent;


//PropertyRegistry  构建和显示键位
//HelKeyEvents  按下键位的操作

@OnlyIn(Dist.CLIENT)
public class KeyBandinglist {
    public static KeyBinding keyBinding;

    private static KeyBinding _add(String name,int key)
    {
        return new KeyBinding(
                "key."+ examplemod.MODID + "." + name, //快捷键名字
                key,
                "key." + examplemod.MODID + "." + "category");//分类名字
    }

    public static void register(final FMLClientSetupEvent event)
    {
        keyBinding = _add("example_key", KeyEvent.VK_Z);
        ClientRegistry.registerKeyBinding(keyBinding);
    }
    //在event中响应这个按键触发的效果
}
